package top.ochiamalu.aioj.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * oauth类型enum
 *
 * @author ochiamalu
 * @date 2025/03/12
 */
@Getter
@AllArgsConstructor
public enum OAuthTypeEnum {
    GITHUB(0, "github"),
    GITEE(1, "gitee"),
    QQ(2, "qq"),
    WECHAT(3, "wechat");

    private final Integer value;
    private final String type;

    public static OAuthTypeEnum getByType(String type) {
        for (OAuthTypeEnum oAuthType : OAuthTypeEnum.values()) {
            if (oAuthType.getType().equals(type)) {
                return oAuthType;
            }
        }
        return null;
    }
} 